package com.example.smartmedicalsystem.service;

import com.example.smartmedicalsystem.entity.Schedule;
import com.example.smartmedicalsystem.repository.ScheduleRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.List;

@Service
@RequiredArgsConstructor
public class ScheduleService {
    private final ScheduleRepository scheduleRepository;

    public List<Schedule> getSchedulesByDepartmentAndDate(Long departmentId, LocalDate date) {
        return scheduleRepository.findByDoctor_Department_IdAndScheduleDate(departmentId, date);
    }

    public List<Schedule> getSchedulesByDepartment(Long departmentId) {
        return scheduleRepository. findByDepartmentId(departmentId);
    }
}